import axios from '@/utils/http';
import base from './base';

export default {
  // 群公告列表
  index(params) {
    return axios.get(`${base.sq}/groups/${params.groupId}/group_notices`);
  },
  // 创建群公告
  create(params) {
    return axios.post(
      `${base.sq}/groups/${params.groupId}/group_notices`,
      {
        title: params.title,
        content: params.content,
      },
    );
  },
  // 展示群公告
  show(params) {
    return axios.get(`${base.sq}/groups/${params.groupId}/group_notices/${params.id}`);
  },
  // 删除群公告
  delete(params) {
    return axios.delete(`${base.sq}/groups/${params.groupId}/group_notices/${params.id}`);
  },
};
